import request from '@/utils/request'
import { downloadAction } from '@/api/requestEvents'

//获得项目验收申请分页
export function acceptApplyPage(params: any) {
  return request({
    url: '/project/accept-apply/page',
    method: 'get',
    params,
  })
}

//获得项目验收申请详情
export function acceptApplyGet(params: any) {
  return request({
    url: '/project/accept-apply/get',
    method: 'get',
    params,
  })
}

//创建项目验收申请
export function acceptApplyCreate(data: any) {
  return request({
    url: '/project/accept-apply/create',
    method: 'post',
    data,
  })
}

//修改验收结论
export function acceptApplyUpdate(data: any) {
  return request({
    url: '/project/accept-apply/updateAcceptResult',
    method: 'put',
    data,
  })
}

//导出项目验收申请 Excel
export function acceptApplyExport(params: any) {
  downloadAction(
    '/project/accept-apply/export-excel',
    'get',
    params,
    '项目验收申请列表.xls'
  )
}

//附件上传
export function acceptApplyUploadFile(data: any) {
  return request({
    url: '/project/accept-apply/uploadFile',
    method: 'post',
    data,
  })
}